import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment";
//房间管理
const apiBedInfo = {
    getTreeList: function(areaId, buildingId) {
        const data = {
            areaId,
            buildingId
        }
        return request({
            url: baseUrl + "/manageRoom/getTreeList",
            method: "post",
            data: qs.stringify(data)
        });
    },
    GetBedInfo: function(id) {
        const data = {
            id
        }
        return request({
            url: baseUrl + "/manageBeds/getBedInfo",
            method: "post",
            data: qs.stringify(data)
        });
    },
    List: function(page, search, order) {
        const data = { page, search, order };
        return request({
            url: baseUrl + "/manageBeds/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    getManageDictionaryDetailList: function(search) {
        const data = {
            search
        };
        return request({
            url: baseUrl + "/manageDictionaryDetail/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    // 添加或编辑房间管理
    Edit: function(data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/manageBeds/save", data, config)
    },
}
export {
    apiBedInfo
}